feat(sdk): to-do card builders + NIP-TC spec - #4929
Closed
mcdickenson wants to merge 2 commits into
Closed
Conversation
Registers KIND_CARD_RESPONSE (40009) so clients can publish signed check-off responses to interactive card messages (e tag → card event, item tag → item id). Channel-scoped like other stream-message kinds: requires an h tag, MessagesWrite scope, and channel membership via the generic ingest pipeline. Card state stays a client-side fold — the relay stores raw events only, and feed/unread queries are unaffected because they use explicit kind inclusion lists. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Matt Dickenson <mdickenson@squareup.com>
Adds build_todo_card_message (fenced buzz:todo-card v1 payload with per-assignee p-tags) and build_card_response (kind:40009 check-off), plus docs/nips/NIP-TC.md pinning the v1 JSON schema, response tag shape, and client-side fold semantics. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Matt Dickenson <mdickenson@squareup.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Stacked on #4924 (
feature/todo-card-response-kind, relay kind:40009 support). This branch includes that commit; the diff shown here vsmaincontains both until #4924 merges. Only the top commit (329d47e) is new in this PR.What
crates/buzz-sdk/src/builders.rs—build_todo_card_message: builds an ordinary stream message whose content carries the fenced```buzz:todo-cardv1 JSON payload (title + 1..=20 items, optional per-item assignee), adding oneptag per distinct assignee so existing mention delivery notifies them.build_card_response: builds a user-signed kind:40009 check-off event ({"done":bool}content;h/e/itemtags).crates/buzz-sdk/src/lib.rs— exports the new builders.docs/nips/NIP-TC.md— the To-Do Cards spec: v1 payload schema and constraints, kind:40009 response tag shape, deterministic client-side state fold (latest-per-pubkey, assignee-authoritative), relay processing (no new storage/read model; responses excluded from timeline/unread/mention kind sets by construction), and security considerations.Why
v1 cards are authored by agents and CLI tooling via these builders; humans interact by checking items. Pinning the schema and fold semantics in a NIP keeps the desktop renderer, the SDK, and the relay change (#4924) agreeing on one contract.
Test evidence (run on this branch at 329d47e)
cargo test -p buzz-sdk: 256 pass, 0 fail (includes 4 new builder tests)Stack
mainindependently.🤖 Generated with Claude Code